import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/inspec/get_my_unit_list_entity.dart';

GetMyUnitListEntity $GetMyUnitListEntityFromJson(Map<String, dynamic> json) {
  final GetMyUnitListEntity getMyUnitListEntity = GetMyUnitListEntity();
  final int? completedNum = jsonConvert.convert<int>(json['completedNum']);
  if (completedNum != null) {
    getMyUnitListEntity.completedNum = completedNum;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getMyUnitListEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    getMyUnitListEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getMyUnitListEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getMyUnitListEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getMyUnitListEntity.id = id;
  }
  final int? incompleteNum = jsonConvert.convert<int>(json['incompleteNum']);
  if (incompleteNum != null) {
    getMyUnitListEntity.incompleteNum = incompleteNum;
  }
  final String? patrolSchemeId = jsonConvert.convert<String>(json['patrolSchemeId']);
  if (patrolSchemeId != null) {
    getMyUnitListEntity.patrolSchemeId = patrolSchemeId;
  }
  final String? tbBaseRiskUnitId = jsonConvert.convert<String>(json['tbBaseRiskUnitId']);
  if (tbBaseRiskUnitId != null) {
    getMyUnitListEntity.tbBaseRiskUnitId = tbBaseRiskUnitId;
  }
  final String? tbBaseRiskUnitName = jsonConvert.convert<String>(json['tbBaseRiskUnitName']);
  if (tbBaseRiskUnitName != null) {
    getMyUnitListEntity.tbBaseRiskUnitName = tbBaseRiskUnitName;
  }
  final int? unitSort = jsonConvert.convert<int>(json['unitSort']);
  if (unitSort != null) {
    getMyUnitListEntity.unitSort = unitSort;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    getMyUnitListEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    getMyUnitListEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    getMyUnitListEntity.updateDate = updateDate;
  }
  return getMyUnitListEntity;
}

Map<String, dynamic> $GetMyUnitListEntityToJson(GetMyUnitListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['completedNum'] = entity.completedNum;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['incompleteNum'] = entity.incompleteNum;
  data['patrolSchemeId'] = entity.patrolSchemeId;
  data['tbBaseRiskUnitId'] = entity.tbBaseRiskUnitId;
  data['tbBaseRiskUnitName'] = entity.tbBaseRiskUnitName;
  data['unitSort'] = entity.unitSort;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension GetMyUnitListEntityExtension on GetMyUnitListEntity {
  GetMyUnitListEntity copyWith({
    int? completedNum,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    int? incompleteNum,
    String? patrolSchemeId,
    String? tbBaseRiskUnitId,
    String? tbBaseRiskUnitName,
    int? unitSort,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return GetMyUnitListEntity()
      ..completedNum = completedNum ?? this.completedNum
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..incompleteNum = incompleteNum ?? this.incompleteNum
      ..patrolSchemeId = patrolSchemeId ?? this.patrolSchemeId
      ..tbBaseRiskUnitId = tbBaseRiskUnitId ?? this.tbBaseRiskUnitId
      ..tbBaseRiskUnitName = tbBaseRiskUnitName ?? this.tbBaseRiskUnitName
      ..unitSort = unitSort ?? this.unitSort
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
